package com.nulldev.util.uri.iwebkit2.document;

import com.nulldev.util.other.ArrayUtils;

public enum ElementClass {
	ROOT("#root"),
	HTML("html"),
	HEAD("head", "header"),
	BODY("body"),
	STYLE("style"),
	SCRIPT("script"),
	H1("h1"),
	H2("h2"),
	
	P("p"), 
	TITLE("title"),
	;
	
	private final String[] tags;
	private ElementClass(final String... tags) {
		this.tags = tags;
	}
	
	public String[] getTags() {
		return this.tags;
	}
	
	public static ElementClass parse(final String tag) {
		for (final ElementClass element : ElementClass.values()) {
			if (ArrayUtils.contains(element.getTags(), tag)) {
				return element;
			}
		}
		return null;
	}
}
